3.1.24 \(\int \tan ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx\) [24]

Optimal. Leaf size=126 \[ 4 i a^3 x+\frac {4 a^3 \log (\cos (c+d x))}{d}-\frac {4 i a^3 \tan (c+d x)}{d}+\frac {2 a^3 \tan ^2(c+d x)}{d}+\frac {4 i a^3 \tan ^3(c+d x)}{3 d}-\frac {11 a^3 \tan ^4(c+d x)}{20 d}-\frac {\tan ^4(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{5 d} \]

[Out]

4*I*a^3*x+4*a^3*ln(cos(d*x+c))/d-4*I*a^3*tan(d*x+c)/d+2*a^3*tan(d*x+c)^2/d+4/3*I*a^3*tan(d*x+c)^3/d-11/20*a^3*
tan(d*x+c)^4/d-1/5*tan(d*x+c)^4*(a^3+I*a^3*tan(d*x+c))/d

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 126, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.208, Rules used = {3637, 3673, 3609, 3606, 3556} \begin {gather*} -\frac {\tan ^4(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{5 d}-\frac {11 a^3 \tan ^4(c+d x)}{20 d}+\frac {4 i a^3 \tan ^3(c+d x)}{3 d}+\frac {2 a^3 \tan ^2(c+d x)}{d}-\frac {4 i a^3 \tan (c+d x)}{d}+\frac {4 a^3 \log (\cos (c+d x))}{d}+4 i a^3 x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^3*(a + I*a*Tan[c + d*x])^3,x]

[Out]

(4*I)*a^3*x + (4*a^3*Log[Cos[c + d*x]])/d - ((4*I)*a^3*Tan[c + d*x])/d + (2*a^3*Tan[c + d*x]^2)/d + (((4*I)/3)
*a^3*Tan[c + d*x]^3)/d - (11*a^3*Tan[c + d*x]^4)/(20*d) - (Tan[c + d*x]^4*(a^3 + I*a^3*Tan[c + d*x]))/(5*d)

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3606

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[b*d*(Tan[e + f*x]/f), x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3637

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim
p[b^2*(a + b*Tan[e + f*x])^(m - 2)*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(m + n - 1))), x] + Dist[a/(d*(m + n - 1
)), Int[(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^n*Simp[b*c*(m - 2) + a*d*(m + 2*n) + (a*c*(m - 2) +
b*d*(3*m + 2*n - 4))*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a
^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && IntegerQ[2*m] && GtQ[m, 1] && NeQ[m + n - 1, 0] && (IntegerQ[m] || Intege
rsQ[2*m, 2*n])

Rule 3673

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[B*d*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e
 + f*x])^m*Simp[A*c - B*d + (B*c + A*d)*Tan[e + f*x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b
*c - a*d, 0] &&  !LeQ[m, -1]

Rubi steps

\begin {align*} \int \tan ^3(c+d x) (a+i a \tan (c+d x))^3 \, dx &=-\frac {\tan ^4(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{5 d}+\frac {1}{5} a \int \tan ^3(c+d x) (a+i a \tan (c+d x)) (9 a+11 i a \tan (c+d x)) \, dx\\ &=-\frac {11 a^3 \tan ^4(c+d x)}{20 d}-\frac {\tan ^4(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{5 d}+\frac {1}{5} a \int \tan ^3(c+d x) \left (20 a^2+20 i a^2 \tan (c+d x)\right ) \, dx\\ &=\frac {4 i a^3 \tan ^3(c+d x)}{3 d}-\frac {11 a^3 \tan ^4(c+d x)}{20 d}-\frac {\tan ^4(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{5 d}+\frac {1}{5} a \int \tan ^2(c+d x) \left (-20 i a^2+20 a^2 \tan (c+d x)\right ) \, dx\\ &=\frac {2 a^3 \tan ^2(c+d x)}{d}+\frac {4 i a^3 \tan ^3(c+d x)}{3 d}-\frac {11 a^3 \tan ^4(c+d x)}{20 d}-\frac {\tan ^4(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{5 d}+\frac {1}{5} a \int \tan (c+d x) \left (-20 a^2-20 i a^2 \tan (c+d x)\right ) \, dx\\ &=4 i a^3 x-\frac {4 i a^3 \tan (c+d x)}{d}+\frac {2 a^3 \tan ^2(c+d x)}{d}+\frac {4 i a^3 \tan ^3(c+d x)}{3 d}-\frac {11 a^3 \tan ^4(c+d x)}{20 d}-\frac {\tan ^4(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{5 d}-\left (4 a^3\right ) \int \tan (c+d x) \, dx\\ &=4 i a^3 x+\frac {4 a^3 \log (\cos (c+d x))}{d}-\frac {4 i a^3 \tan (c+d x)}{d}+\frac {2 a^3 \tan ^2(c+d x)}{d}+\frac {4 i a^3 \tan ^3(c+d x)}{3 d}-\frac {11 a^3 \tan ^4(c+d x)}{20 d}-\frac {\tan ^4(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{5 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(296\) vs. \(2(126)=252\).
time = 1.33, size = 296, normalized size = 2.35 \begin {gather*} \frac {a^3 \sec (c) \sec ^5(c+d x) \left (105 \cos (2 c+3 d x)+150 i d x \cos (2 c+3 d x)+105 \cos (4 c+3 d x)+150 i d x \cos (4 c+3 d x)+30 i d x \cos (4 c+5 d x)+30 i d x \cos (6 c+5 d x)+75 \cos (2 c+3 d x) \log \left (\cos ^2(c+d x)\right )+75 \cos (4 c+3 d x) \log \left (\cos ^2(c+d x)\right )+15 \cos (4 c+5 d x) \log \left (\cos ^2(c+d x)\right )+15 \cos (6 c+5 d x) \log \left (\cos ^2(c+d x)\right )+75 \cos (d x) \left (3+4 i d x+2 \log \left (\cos ^2(c+d x)\right )\right )+75 \cos (2 c+d x) \left (3+4 i d x+2 \log \left (\cos ^2(c+d x)\right )\right )-470 i \sin (d x)+360 i \sin (2 c+d x)-280 i \sin (2 c+3 d x)+135 i \sin (4 c+3 d x)-83 i \sin (4 c+5 d x)\right )}{240 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^3*(a + I*a*Tan[c + d*x])^3,x]

[Out]

(a^3*Sec[c]*Sec[c + d*x]^5*(105*Cos[2*c + 3*d*x] + (150*I)*d*x*Cos[2*c + 3*d*x] + 105*Cos[4*c + 3*d*x] + (150*
I)*d*x*Cos[4*c + 3*d*x] + (30*I)*d*x*Cos[4*c + 5*d*x] + (30*I)*d*x*Cos[6*c + 5*d*x] + 75*Cos[2*c + 3*d*x]*Log[
Cos[c + d*x]^2] + 75*Cos[4*c + 3*d*x]*Log[Cos[c + d*x]^2] + 15*Cos[4*c + 5*d*x]*Log[Cos[c + d*x]^2] + 15*Cos[6
*c + 5*d*x]*Log[Cos[c + d*x]^2] + 75*Cos[d*x]*(3 + (4*I)*d*x + 2*Log[Cos[c + d*x]^2]) + 75*Cos[2*c + d*x]*(3 +
 (4*I)*d*x + 2*Log[Cos[c + d*x]^2]) - (470*I)*Sin[d*x] + (360*I)*Sin[2*c + d*x] - (280*I)*Sin[2*c + 3*d*x] + (
135*I)*Sin[4*c + 3*d*x] - (83*I)*Sin[4*c + 5*d*x]))/(240*d)

________________________________________________________________________________________

Maple [A]
time = 0.05, size = 83, normalized size = 0.66

method result size
derivativedivides \(\frac {a^{3} \left (-4 i \tan \left (d x +c \right )-\frac {i \left (\tan ^{5}\left (d x +c \right )\right )}{5}-\frac {3 \left (\tan ^{4}\left (d x +c \right )\right )}{4}+\frac {4 i \left (\tan ^{3}\left (d x +c \right )\right )}{3}+2 \left (\tan ^{2}\left (d x +c \right )\right )-2 \ln \left (1+\tan ^{2}\left (d x +c \right )\right )+4 i \arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) \(83\)
default \(\frac {a^{3} \left (-4 i \tan \left (d x +c \right )-\frac {i \left (\tan ^{5}\left (d x +c \right )\right )}{5}-\frac {3 \left (\tan ^{4}\left (d x +c \right )\right )}{4}+\frac {4 i \left (\tan ^{3}\left (d x +c \right )\right )}{3}+2 \left (\tan ^{2}\left (d x +c \right )\right )-2 \ln \left (1+\tan ^{2}\left (d x +c \right )\right )+4 i \arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) \(83\)
risch \(-\frac {8 i a^{3} c}{d}+\frac {2 a^{3} \left (240 \,{\mathrm e}^{8 i \left (d x +c \right )}+585 \,{\mathrm e}^{6 i \left (d x +c \right )}+695 \,{\mathrm e}^{4 i \left (d x +c \right )}+385 \,{\mathrm e}^{2 i \left (d x +c \right )}+83\right )}{15 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}+\frac {4 a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(99\)
norman \(\frac {2 a^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{d}-\frac {3 a^{3} \left (\tan ^{4}\left (d x +c \right )\right )}{4 d}+4 i a^{3} x -\frac {4 i a^{3} \tan \left (d x +c \right )}{d}+\frac {4 i a^{3} \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}-\frac {i a^{3} \left (\tan ^{5}\left (d x +c \right )\right )}{5 d}-\frac {2 a^{3} \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}\) \(109\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d*a^3*(-4*I*tan(d*x+c)-1/5*I*tan(d*x+c)^5-3/4*tan(d*x+c)^4+4/3*I*tan(d*x+c)^3+2*tan(d*x+c)^2-2*ln(1+tan(d*x+
c)^2)+4*I*arctan(tan(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.87, size = 95, normalized size = 0.75 \begin {gather*} -\frac {12 i \, a^{3} \tan \left (d x + c\right )^{5} + 45 \, a^{3} \tan \left (d x + c\right )^{4} - 80 i \, a^{3} \tan \left (d x + c\right )^{3} - 120 \, a^{3} \tan \left (d x + c\right )^{2} - 240 i \, {\left (d x + c\right )} a^{3} + 120 \, a^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 240 i \, a^{3} \tan \left (d x + c\right )}{60 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

-1/60*(12*I*a^3*tan(d*x + c)^5 + 45*a^3*tan(d*x + c)^4 - 80*I*a^3*tan(d*x + c)^3 - 120*a^3*tan(d*x + c)^2 - 24
0*I*(d*x + c)*a^3 + 120*a^3*log(tan(d*x + c)^2 + 1) + 240*I*a^3*tan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 0.45, size = 214, normalized size = 1.70 \begin {gather*} \frac {2 \, {\left (240 \, a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} + 585 \, a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 695 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 385 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 83 \, a^{3} + 30 \, {\left (a^{3} e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{3}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )\right )}}{15 \, {\left (d e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, d e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

2/15*(240*a^3*e^(8*I*d*x + 8*I*c) + 585*a^3*e^(6*I*d*x + 6*I*c) + 695*a^3*e^(4*I*d*x + 4*I*c) + 385*a^3*e^(2*I
*d*x + 2*I*c) + 83*a^3 + 30*(a^3*e^(10*I*d*x + 10*I*c) + 5*a^3*e^(8*I*d*x + 8*I*c) + 10*a^3*e^(6*I*d*x + 6*I*c
) + 10*a^3*e^(4*I*d*x + 4*I*c) + 5*a^3*e^(2*I*d*x + 2*I*c) + a^3)*log(e^(2*I*d*x + 2*I*c) + 1))/(d*e^(10*I*d*x
 + 10*I*c) + 5*d*e^(8*I*d*x + 8*I*c) + 10*d*e^(6*I*d*x + 6*I*c) + 10*d*e^(4*I*d*x + 4*I*c) + 5*d*e^(2*I*d*x +
2*I*c) + d)

________________________________________________________________________________________

Sympy [A]
time = 0.37, size = 207, normalized size = 1.64 \begin {gather*} \frac {4 a^{3} \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {480 a^{3} e^{8 i c} e^{8 i d x} + 1170 a^{3} e^{6 i c} e^{6 i d x} + 1390 a^{3} e^{4 i c} e^{4 i d x} + 770 a^{3} e^{2 i c} e^{2 i d x} + 166 a^{3}}{15 d e^{10 i c} e^{10 i d x} + 75 d e^{8 i c} e^{8 i d x} + 150 d e^{6 i c} e^{6 i d x} + 150 d e^{4 i c} e^{4 i d x} + 75 d e^{2 i c} e^{2 i d x} + 15 d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**3*(a+I*a*tan(d*x+c))**3,x)

[Out]

4*a**3*log(exp(2*I*d*x) + exp(-2*I*c))/d + (480*a**3*exp(8*I*c)*exp(8*I*d*x) + 1170*a**3*exp(6*I*c)*exp(6*I*d*
x) + 1390*a**3*exp(4*I*c)*exp(4*I*d*x) + 770*a**3*exp(2*I*c)*exp(2*I*d*x) + 166*a**3)/(15*d*exp(10*I*c)*exp(10
*I*d*x) + 75*d*exp(8*I*c)*exp(8*I*d*x) + 150*d*exp(6*I*c)*exp(6*I*d*x) + 150*d*exp(4*I*c)*exp(4*I*d*x) + 75*d*
exp(2*I*c)*exp(2*I*d*x) + 15*d)

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 274 vs. \(2 (112) = 224\).
time = 0.91, size = 274, normalized size = 2.17 \begin {gather*} \frac {2 \, {\left (30 \, a^{3} e^{\left (10 i \, d x + 10 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 150 \, a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 300 \, a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 300 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 150 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 240 \, a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} + 585 \, a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 695 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 385 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 30 \, a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 83 \, a^{3}\right )}}{15 \, {\left (d e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, d e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3*(a+I*a*tan(d*x+c))^3,x, algorithm="giac")

[Out]

2/15*(30*a^3*e^(10*I*d*x + 10*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) + 150*a^3*e^(8*I*d*x + 8*I*c)*log(e^(2*I*d*x +
 2*I*c) + 1) + 300*a^3*e^(6*I*d*x + 6*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) + 300*a^3*e^(4*I*d*x + 4*I*c)*log(e^(2
*I*d*x + 2*I*c) + 1) + 150*a^3*e^(2*I*d*x + 2*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) + 240*a^3*e^(8*I*d*x + 8*I*c)
+ 585*a^3*e^(6*I*d*x + 6*I*c) + 695*a^3*e^(4*I*d*x + 4*I*c) + 385*a^3*e^(2*I*d*x + 2*I*c) + 30*a^3*log(e^(2*I*
d*x + 2*I*c) + 1) + 83*a^3)/(d*e^(10*I*d*x + 10*I*c) + 5*d*e^(8*I*d*x + 8*I*c) + 10*d*e^(6*I*d*x + 6*I*c) + 10
*d*e^(4*I*d*x + 4*I*c) + 5*d*e^(2*I*d*x + 2*I*c) + d)

________________________________________________________________________________________

Mupad [B]
time = 3.79, size = 87, normalized size = 0.69 \begin {gather*} -\frac {4\,a^3\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )+a^3\,\mathrm {tan}\left (c+d\,x\right )\,4{}\mathrm {i}-2\,a^3\,{\mathrm {tan}\left (c+d\,x\right )}^2-\frac {a^3\,{\mathrm {tan}\left (c+d\,x\right )}^3\,4{}\mathrm {i}}{3}+\frac {3\,a^3\,{\mathrm {tan}\left (c+d\,x\right )}^4}{4}+\frac {a^3\,{\mathrm {tan}\left (c+d\,x\right )}^5\,1{}\mathrm {i}}{5}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^3*(a + a*tan(c + d*x)*1i)^3,x)

[Out]

-(4*a^3*log(tan(c + d*x) + 1i) + a^3*tan(c + d*x)*4i - 2*a^3*tan(c + d*x)^2 - (a^3*tan(c + d*x)^3*4i)/3 + (3*a
^3*tan(c + d*x)^4)/4 + (a^3*tan(c + d*x)^5*1i)/5)/d

________________________________________________________________________________________